<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width-device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/5.11.2/css/all.css" />
<link rel="stylesheet" href="css/person_update.css" />
<link rel="shortcut icon" href="ico/logo.ico"/>
<title>无标题文档</title>
</head>

<body>
	<!-- 定义头部区域，放导航和logo -->
	<?php  
	include 'action/session_check.php';//登录判断
	   require_once("conn/conn_db.php");
       $sql = "select * from  user_info where u_name ='".$_SESSION[user]."'"; //查询语句
  $result = $conn->query($sql);                 //执行SQL语句
  //遍历查询结果的每一行
  if ($result->num_rows > 0) {
      while($row = $result->fetch_array()){	
	?>
<header>
<div class="logo"><img src="ico/logo.png" alt=""/>伴美科技</div>
<nav>
<a href="javascript:history.back(-1);" target="_self">返回<<<<</a>
<img src='../<?php echo $row['u_header'];?>' style="border-radius: 50%; width: 36px; height: 36px; position: absolute; top: 20px; right: 38px;" alt="User">
<?php 
}
 } 
?>
</nav>
	</header>
	
<!-- 头部导航结束 -->
	
	<div class="container_box">
	<form name="form1" action="action/member_order_add_do.php" method="post">

<?php require_once("action/session_check.php"); ?>


<table cellspacing="10px">
<tr><td align="center" colspan="5"><h2 style="margin-top: 0px;">当前订单信息</h2></td></tr>
<tr>
<td >商品编号</td><td colspan="2" align="center">商品名称</td><td >数量</td><td >金额</td></tr>
   <?php 
if(isset($_SESSION['car']) && $_SESSION['car']!="")  //判断购物车
 {
  $arr2 = (array)$_SESSION['car'];  //将购物车SESSION变量赋值给数组变量
  $p_nums = 0;  //声明变量，存储订单商品数量
  $o_money = 0; //声明变量，存储订单金额
  foreach ($arr2 as $key1=> $value1 )  //遍历购物车数组
  { 
  	echo "<tr>";
  	echo "<td class='h5'>". $value1[0]."</td>";
  	echo "<td class='h5'>". $value1[1]."</td>";
  	echo "<td><img src='". $value1[2]."' width='50px' height='50px'/></td>";
  	echo "<td class='h5'>". $value1[3]."</td>";
  	echo "<td class='h5'>". $value1[4]."</td>";
    echo"</tr>";
    $p_nums += (int)$value1[3];    //订单商品数量累加
    $o_money += (float)$value1[4]; //订单金额累加
  }
 } else {
     echo "<script>alert('当前购物车为空，请先选择要购买的商品信息！');self.location='index_content.php'</script>";
 }
 ?>

   <tr><td colspan="2" class="h5" align="right">用户名：</td>
      <td class="h5" colspan="3"> <?php echo $_SESSION['user'];?>
	<input type="hidden" name="txt_username" value="<?php echo $_SESSION['user'];?>"/></td>
  </tr>
  <tr><td colspan="2"  align="right">商品数量：</td>
      <td colspan="3" ><h5><?php echo $p_nums;?></h5><input type="hidden" name="txt_pnums" value="<?php echo $p_nums;?>"/></td>
  </tr>
  <tr><td colspan="2" class="h5" align="right">订单金额：</td>
      <td colspan="3"><h5>￥<?php echo $o_money;?><input type="hidden" name="txt_omoney" value="<?php echo $o_money;?>"/></h5></td>
  </tr>
  <tr><td colspan="2" class="h5" align="right"><font color="red">*</font>收货人：</td>
      <td colspan="3" class="h5"> <input type="text" name="txt_taker" class="search"/></td>
  </tr>
  <tr><td colspan="2" class="h5" align="right"><font color="red">*</font>收货地址：</td>
      <td colspan="3" class="h5"> <input type="text" name="txt_address" class="search"/></td>
  </tr>
  <tr><td colspan="2" class="h5" align="right"><font color="red">*</font>联系电话：</td>
      <td colspan="3" class="h5"> <input type="text" name="txt_tel" class="search"/></td>
  </tr>
  <tr><td colspan="2" class="h5" align="right"><font color="red">*</font>付款方式：</td>
      <td colspan="3" class="h5"> <select name="txt_paymethod" class="search">
      <option value="货到付款">货到付款</option>
      <option value="支付宝付款">支付宝付款</option>
      <option value="信用卡付款">信用卡付款</option>
         </select>
      </td>
  </tr>
  <tr><td colspan="2" class="h5" align="right">备注：</td>
      <td colspan="3" class="h5"> <textarea name="txt_remark" class="search"></textarea></td>
  </tr>
  <tr><td colspan="5" align="center" height="50px"><input type="submit" value="提交订单" style="
	  height: 30px;
		width: 80px; border-radius: 5px; background: #f79f1f; color: white; border: 0px;"> </td></tr>
 </table>
 </form>
	</div>
	
	<!-- 底部模块开始 -->	
	<footer>
    <div class="footer-menus">
	   <div class="contact-us">
		    <p class="menu-title">联系我们</p>
		    <p>地址：中国重庆市XX路XX商务中心XX楼</p>
		   　<p>电话：+86XXX XXXX XXXX</p>
		   　<p>传真：+86XXX　XXXX XXXX</p>
		  　 <p>电子邮箱：admin@163.com</p>
	   </div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">服务概况</p>
		  <ul class="menu-items">
		     <li><a href="#">跨境电商</a></li>
			 <li><a href="#">供应商</a></li>
			 <li><a href="#">移动应用</a></li>
			 <li><a href="#">网页设计</a></li>
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">跨境产品</p>
		  <ul class="menu-items">
		     <li><a href="#">美妆护肤</a></li>
			 <li><a href="#">家用电器</a></li>
			 <li><a href="#">健康零食</a></li>
			 <li><a href="#">生活用品</a></li>
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">公司动态</p>
		  <ul class="menu-items">
		     <li><a href="#">信息公开</a></li>
			 <li><a href="#">最近新闻</a></li>
			 <li><a href="#">最新消息</a></li>
			 
		  </ul>
		</div>
		<div class="service-menu footer-menu">
		  <p class="menu-title">帮助与支持</p>
		  <ul class="menu-items">
		     <li><a href="#">帮助中心</a></li>
			 <li><a href="#">联系客服</a></li>
			 <li><a href="#">文档资源</a></li>
			
		  </ul>
		</div>
		<p class="icp-info">备案号信息</p>
		<p class="rights">
		      &copy;2022 伴美科技 - 有限责任公司官网 版权所有
		</p>
		

	</div>	
</footer>
<!-- 底部模块结束 -->	
	
</body>
</html>